import React from 'react';
import { StyleSheet, Text, TouchableOpacity,Image } from 'react-native';
import { px2dp } from '../../../../../common/styles/index';
import LinearGradient from 'react-native-linear-gradient'
/**
 * @author kanglang
 * @description 发布按钮
 * @createDate 2020/7/27
 */
export default function SendBtn(
    { style, colors = ['#E5B867', '#BB934B'], tips = "发布", toSendGoods,icons } = this.props
) {
    const submitBtn = () => {
        toSendGoods();
    };
    return (
        <TouchableOpacity activeOpacity={0.9} style={styles.common} onPress={submitBtn}>
            <LinearGradient
                style={[styles.common, style]}
                stystart={{ x: 1, y: 1 }} end={{ x: 1, y: 1 }}
                colors={colors}
            >
                <Image style={styles.iconStyle} source={icons}/>
                <Text style={styles.tips}> {tips}</Text>
            </LinearGradient>
        </TouchableOpacity>
    );
}
const styles = StyleSheet.create({
    common: {
        flexDirection:'row',
        height: px2dp(44) * 2,
        width: px2dp(131) * 2,
        borderRadius: px2dp(24) * 2,
        justifyContent: 'center',
        alignItems: 'center'
    },
    iconStyle: {
        width: px2dp(12)*2,
        height: px2dp(12)*2
    },
    tips: {
        color: '#FFFFFF',
        fontSize: px2dp(16) * 2,
        fontWeight: 'bold'
    }
});